import { app, Menu } from 'electron';
import * as MenuAction from './menuactions';

const template = [
    {
        label: app.getName(),
        submenu: [{ role: 'quit' }]
    },
    {
        label: '幻灯片',
        submenu: [
            {
                label: '打开文件夹...',
                click: MenuAction.OpenDirectory
            },
            { type: 'separator' },
            { role: 'togglefullscreen' }
        ]
    }
];

export default function() {
    const menu = Menu.buildFromTemplate(template);
    if (process.platform == 'darwin') {
        Menu.setApplicationMenu(menu);
    }
}
